package com.whz.eq;

import com.google.common.collect.Lists;

import java.awt.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;

/**
 * @Author: sinosoft
 * @Description:
 * @Date: Create in 16:59 2021/4/30
 * @Modified By:
 */
public class MainTest {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Point p = new Point(1, 2);
        ColorPoint cp = new ColorPoint(1, 2, Color.BLUE);
        boolean result1 = p.equals(cp);
        boolean result2 = cp.equals(p);
        CaseInsensitiveString cis = CaseInsensitiveString.create("Polish");
        String s = "polish";

        /*
        * 违反了equals 的对称性原则
        * */
//        System.out.println(cis.equals(s));
//        System.out.println(s.equals(cis));

        ArrayList<CaseInsensitiveString> cisList =
                Lists.newArrayListWithCapacity(10);
        cisList.add(CaseInsensitiveString.create("A"));
//        cisList.add(CaseInsensitiveString.create("a"));
//        cisList.add(CaseInsensitiveString.create("b"));
        cisList.add(CaseInsensitiveString.create("B"));
        cisList.add(CaseInsensitiveString.create("C"));
//        cisList.add(CaseInsensitiveString.create("c"));
//        cisList.add(CaseInsensitiveString.create("d"));

//        System.out.println(cisList.contains(CaseInsensitiveString.create("a")));
//

//        Class<?> clazz = Class.forName("com.whz.eq.CaseInsensitiveString");
//        Constructor<?> cisConstructor = clazz.getDeclaredConstructor(String.class);
//        cisConstructor.setAccessible(true);
//        CaseInsensitiveString refCaseInsensitiveString = (CaseInsensitiveString) cisConstructor.newInstance("D");
//        System.out.println(refCaseInsensitiveString);

        System.out.println(Short.MAX_VALUE);

    }



}
